feat(analysis): Analysis Mode URL hash deep link support (#617)#652
Merged
cct08311github merged 1 commit intodotnet8from Mar 18, 2026
Merged
feat(analysis): Analysis Mode URL hash deep link support (#617)#652cct08311github merged 1 commit intodotnet8from
cct08311github merged 1 commit intodotnet8from
Conversation
5 tasks
- Add hashSerialize(gridId) — encodes current dims/msrs/filters/pivot/chartType as URLSearchParams-style hash (#gid=…&vm=…&dims=…&msrs=…&f0=…&ct=…) - Add hashDeserialize(hashStr) — parses hash back to structured state object; returns null for missing/malformed gid or vm params - Add hashApply(gridId, parsed) — restores dims/msrs as drop-zone pills, adds filter rows with field/op/value, sets chartType preference, triggers query - Add hashPush(gridId) — calls history.pushState after each successful query; replaceState clears hash when selection is empty - Register popstate listener (once at module load) to restore query on back/forward - Call hashApplyFromLocation(gridId) at end of renderPanel() so a fresh page load from a shared URL auto-replays the query - Export all four public functions for testability - 16 new Jest tests: null/malformed hash, gid/vm parsing, dims/msrs/filters/pivot/ chartType round-trip, filter value with pipe, history API guards (486 total, all pass) Closes #617 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b8bd8b3 to
77d5742
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hashSerialize/hashDeserializepure functions to encode/decode Analysis Mode query state (dims, msrs, filters, pivot, chartType) into URL hashhashPush(gridId)— called after each successful query to push state viahistory.pushStatefor back-button supporthashApply(gridId, state)+hashApplyFromLocation(gridId)— programmatically restores drop-zone pills, filter rows, and chart type from hash on page loadpopstatelistener (once at module init) to re-apply state on browser back/forward navigationrenderPanel()(auto-restore on load) andquery()success (push state after render)|are handled correctly (split on|with max-3-split)Tests
framework_analysis.test.jscovering:hashDeserializeedge cases (empty, missing gid/vm, malformed encoding), full round-trip parsing (dims/msrs/filters/pivot/chartType),hashPushhistory API guardsTest plan
Closes #617